package com.szss.springbootfirst.entity;

import java.io.Serializable;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Emp implements Serializable {
    private String empno;
    private String name;
    private Integer mgr;
    private String job;
    private Date hireDate;
    private Double salary;
    private Double comm;
    private Integer deptno;
    private String deptname;
    public Emp() {

    }

    public Emp(String empno, String name, Integer mgr, String job, String hireDate, Double salary, Double comm, Integer deptno, String deptname) {
        this.empno = empno;
        this.name = name;
        this.mgr = mgr;
        this.job = job;
        if(hireDate!=null){
            SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
            try {
                this.hireDate = sf.parse(hireDate);
            } catch (ParseException e) {
                e.printStackTrace();
            }
        }
        this.salary = salary;
        this.comm = comm;
        this.deptno = deptno;
        this.deptname = deptname;
    }

    public String getEmpno() {
        return empno;
    }

    public void setEmpno(String empno) {
        this.empno = empno;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getMgr() {
        return mgr;
    }

    public void setMgr(Integer mgr) {
        this.mgr = mgr;
    }

    public String getJob() {
        return job;
    }

    public void setJob(String job) {
        this.job = job;
    }

    public Date getHireDate() {
        return hireDate;
    }

    public void setHireDate(Date hireDate) {
        this.hireDate = hireDate;
    }

    public Double getSalary() {
        return salary;
    }

    public void setSalary(Double salary) {
        this.salary = salary;
    }

    public Double getComm() {
        return comm;
    }

    public void setComm(Double comm) {
        this.comm = comm;
    }

    public Integer getDeptno() {
        return deptno;
    }

    public void setDeptno(Integer deptno) {
        this.deptno = deptno;
    }

    public String getDeptname() {
        return deptname;
    }

    public void setDeptname(String deptname) {
        this.deptname = deptname;
    }
}
